from Bases import BaseObject
from bases import widgets, tree

class OSCTree(BaseObject):
    def __init__(self, **kwargs):
        super(OSCTree, self).__init__(**kwargs)
        self.root_node = kwargs.get('root_node')
        self.base_dict = {'root':self.root_node}
        self.tree = tree.GenericTreeStore(column_names=['name'], column_types=[str], show_dicts=False, 
                                          obj_name_attr='saved_class_name', child_name_attr='saved_child_objects', 
                                          base_dict=self.base_dict, column_attr_map={'name':{'OSCNode':'_name'}})
        self.widget = widgets.Tree(name='OSC Nodes', model=self.tree, columns={0:'name'})
